package com.example.demo;

import com.example.demo.service.SpiTestService;

import java.util.ServiceLoader;

/**
 * @author void
 * @date 2020/5/24 18:08
 * @desc
 */
public class SpiTest {

    public static void main(String[] args) {
        ServiceLoader<SpiTestService> loaders = ServiceLoader.load(SpiTestService.class);
        for (SpiTestService loader : loaders) {
            loader.test();
        }
    }
}
